<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>sell</title>
  <script src="https://cdn.staticfile.org/vue/2.4.2/vue.min.js"></script>
  <script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script>

  <!-- 日期选择器引入依赖 -->



  <!--  -->

  <link rel="stylesheet" href="plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
  <link rel="stylesheet" href="plugins/datatables-responsive/css/responsive.bootstrap4.min.css">
  <link rel="stylesheet" href="dist/css/adminlte.min.css">
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
  <link type="text/css" rel="stylesheet" charset="UTF-8"
    href="https://translate.googleapis.com/translate_static/css/translateelement.css">
  <!-- Google Font: Source Sans Pro -->
  <link rel="stylesheet"
    href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
  <!-- Font Awesome Icons -->
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css">
  <!-- IonIcons -->
  <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="dist/css/adminlte.min.css">
</head>
<!--
`body` tag options:

  Apply one or more of the following classes to to the body tag
  to get the desired effect

  * sidebar-collapse
  * sidebar-mini
-->

<body class="hold-transition sidebar-mini">
  <div class="wrapper">
    <div class="content">
      <div class="container-fluid">
        <div class="row">
          <div class="col-lg-12">
            <div class="card card-default" id="addcard" style="display: none;">
              <div class="card-header">
                <h3 class="card-title">
                  <font style="vertical-align: inherit;">
                    <font style="vertical-align: inherit;">添加</font>
                  </font>
                </h3>
                <div class="card-tools">
                  <button onclick="addchooselist()" type="button" class="btn btn-primary"> 提交</button> &nbsp;
                  <button type="button" class="btn btn-primary">
                    Action
                  </button>
                  <button type="button" class="btn btn-tool" data-card-widget="collapse"><i
                      class="fas fa-minus"></i></button>
                  <button onclick="drop_add()" type="button" class="btn btn-tool"><i class="fas fa-times"></i></button>
                </div>
              </div>
              <!-- /.card-header -->
              <div class="card-body">
                <div class="row">
                  <div class="col-md-4">
                    <div class="row">
                      <div class="col-md-3">
                        <p>品类：</p><br>
                        <p>单号：</p><br>
                        <p>区域：</p><br>
                      </div>
                      <div class="col-md-9">
                        <input id="category" type="text" placeholder="黄金"
                          style="width: 200px; height: 35px; display: block;" value="黄金"><br>
                        <input id="form" type="text" placeholder="--"
                          style="width: 200px; height: 35px; display: block;" value="ps123123"><br>
                        <ul class="navbar-nav nav-sidebar ">
                          <li class="nav-item d-none d-sm-inline-block">
                            <select id="area" class="selectpicker show-tick form-control" style="width: 200px;">
                              <option>华南</option>
                              <option>华北</option>
                            </select>
                          </li>
                        </ul> <br>
                      </div>
                    </div>
                  </div>
                  <div class="col-md-4">
                    <div class="row">
                      <div class="col-md-3">
                        <p>产品名称：</p><br>
                        <p>客户：</p><br>
                        <p>状态：</p><br>
                      </div>
                      <div class="col-md-9">
                        <input id="goods_name" type="text" placeholder="黄金"
                          style="width: 200px; height: 35px; display: block;" value="黄金"><br>
                        <ul class="navbar-nav nav-sidebar ">
                          <li class="nav-item d-none d-sm-inline-block">
                            <select id="client" class="selectpicker show-tick form-control" style="width: 200px;">
                              <option>不摇碧莲</option>
                              <option>张楚岚</option>
                            </select>
                          </li>
                        </ul> <br>
                        <ul class="navbar-nav nav-sidebar ">
                          <li class="nav-item d-none d-sm-inline-block">
                            <select id="status" class="selectpicker show-tick form-control" style="width: 200px;">
                              <option>0</option>
                              <option>1</option>
                            </select><br>
                          </li>
                        </ul>
                      </div>
                    </div>
                  </div>
                  <div class="col-md-4">
                    <div class="row">
                      <div class="col-md-3">
                        <p>制单时间：</p><br>
                        <p>成色：</p><br>
                        <p>数量：</p><br>
                      </div>
                      <div class="col-md-9">
                        <input id="time" type="datetime-local" style="width: 200px; height: 35px; display: block;"><br>
                        <ul class="navbar-nav nav-sidebar ">
                          <li class="nav-item d-none d-sm-inline-block">
                            <select id="quality" class="selectpicker show-tick form-control" style="width: 200px;">
                              <option>万足金10000</option>
                              <option>千足金999</option>
                            </select>
                          </li>
                        </ul><br>
                        <input id="amount" type="text" placeholder="1"
                          style="width: 200px; height: 35px; display: block;" value="1"><br>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="card">
              <div class="card-body" id="app1">
                <div id="example1_wrapper" class="dataTables_wrapper dt-bootstrap4">
                  <div class="row">
                    <div class="col-sm-12">
                      <nav class=" navbar navbar-expand navbar-white navbar-light">
                        <ul class="navbar-nav nav-sidebar ">
                          <li class="nav-item d-none d-sm-inline-block">
                            <a onclick="show_add()" href="#" class="nav-link">
                              <i class="fas fa-plus nav-icon"></i>
                              <p>新增单</p>
                            </a>
                          </li>
                          <li class="nav-item d-none d-sm-inline-block">
                            <a href="#" class="nav-link">
                              <i class="fas  fa-random nav-icon"></i>
                              <p>导出</p>
                            </a>
                          </li>
                        </ul>
                      </nav>
                      <table id="example1" class="table table-bordered table-striped dataTable dtr-inline" role="grid"
                        aria-describedby="example1_info">
                        <thead>
                          <tr role="row">
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="Rendering engine: activate to sort column ascending">序号</th>
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="Browser: activate to sort column ascending" style="">单号</th>
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="Platform(s): activate to sort column ascending" style="">产品名称</th>
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="Platform(s): activate to sort column ascending" style="">数量</th>
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="Platform(s): activate to sort column ascending" style="">客户</th>
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="Platform(s): activate to sort column ascending" style="">区域</th>
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="Platform(s): activate to sort column ascending" style="">状态</th>
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="Platform(s): activate to sort column ascending" style="">品类</th>
                            <th class="sorting_desc" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="Engine version: activate to sort column ascending" aria-sort="descending"
                              style="">制单时间</th>
                            <th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1"
                              aria-label="CSS grade: activate to sort column ascending" style="">成色</th>
                          </tr>
                        </thead>
                        <tbody>
                          <tr role="row" class="odd" style="display: none;">
                            <td class="" tabindex="0">Gecko</td>
                            <td style="">Epiphany 2.20</td>
                            <td style="">Gnome</td>
                            <td style="">Epiphany 2.20</td>
                            <td style="">Gnome</td>
                            <td style="">Epiphany 2.20</td>
                            <td style="">Gnome</td>
                            <td style="">Gnome</td>
                            <td style="">1.8</td>
                            <td style="">A</td>
                          </tr>
                          <tr role="row" class="odd" style="display: none;">
                            <td class="" tabindex="0">Gecko</td>
                            <td style="">Epiphany 2.20</td>
                            <td style="">Gnome</td>
                            <td style="">Epiphany 2.20</td>
                            <td style="">Gnome</td>
                            <td style="">Epiphany 2.20</td>
                            <td style="">Gnome</td>
                            <td class="sorting_1" style="">1.8</td>
                            <td style="">A</td>
                            <td style="">A</td>
                          </tr>
                          <tr role="row" class="odd" v-for="(pickGoods,key) in pickGoodss">
                            <td>{{key+1}}</td>
                            <td>{{pickGoods.cgnu}}</td>
                            <td>{{pickGoods.goodsname}}</td>
                            <td>{{pickGoods.num}}</td>
                            <td>{{pickGoods.client}}</td>
                            <td>{{pickGoods.area}}</td>
                            <td>{{pickGoods.status}}</td>
                            <td>{{pickGoods.category}}</td>
                            <td>{{pickGoods.time}}</td>
                            <td>{{pickGoods.quality}}</td>
                          </tr>
                        </tbody>
                        <tfoot>
                        </tfoot>
                      </table>
                    </div>
                  </div>
                </div>
              </div>
              <script>
                function addchooselist() {

                  var category = $("#category").val();
                  var form = $("#form").val();
                  var area = $("#area").val();
                  var goods_name = $("#goods_name").val();
                  var client = $("#client").val();
                  var status = $("#status").val();

                  var time = $("#time").val();

                  var time2 = time.split("T");
                  time2 = time2[0] + time2[1];
                  alert(time2);

                  time = new Date(time);

                  var quality = $("#quality").val();
                  var amount = $("#amount").val();
                  var tr = $("<tr></tr>");;

                  $.ajax({
                    url: "pickgoods/add",
                    type: "post",
                    data: {
                      "category": category,
                      "cgnu": form,
                      "area": area,
                      "goodsname": goods_name,
                      "client": client,
                      "status": status,
                      "time": time,
                      "quality": quality,
                      "amount": amount,

                    },
                    success: function (res) {
                      console.log(res);
                    }
                  });

                  var category1 = $("<td></td>").text(category);
                  var form1 = $("<td></td>").text(form);
                  var area1 = $("<td></td>").text(area);
                  var goods_name1 = $("<td></td>").text(goods_name);
                  var client1 = $("<td></td>").text(client);
                  var status1 = $("<td></td>").text(status);
                  var time1 = $("<td></td>").text(time2);
                  var quality1 = $("<td></td>").text(quality);
                  var amount1 = $("<td></td>").text(amount);
                  tr.append($("#example1").find("tr").length);
                  tr.append(form1);
                  tr.append(goods_name1);
                  tr.append(amount1);
                  tr.append(client1);
                  tr.append(area1);
                  tr.append(status1);
                  tr.append(category1);
                  tr.append(time1);
                  tr.append(quality1);
                  $("#example1").append(tr);
                }
              </script>
              <script>
                new Vue({
                  el: "#app1",
                  data: {
                    pickGoodss: []

                  },
                  mounted() {
                    axios
                      .get('pickgoods/all')
                      .then(res => {
                        console.info(res.data);
                        this.pickGoodss = res.data.data;

                      })
                  }
                });
              </script>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- ./wrapper -->

  <!-- REQUIRED SCRIPTS -->

  <!-- jQuery -->
  <script src="plugins/jquery/jquery.min.js"></script>
  <!-- Bootstrap -->
  <script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
  <!-- AdminLTE -->
  <script src="dist/js/adminlte.js"></script>

  <!-- OPTIONAL SCRIPTS -->
  <script src="plugins/chart.js/Chart.min.js"></script>
  <!-- AdminLTE for demo purposes -->
  <script src="dist/js/demo.js"></script>
  <!-- AdminLTE dashboard demo (This is only for demo purposes) -->
  <script src="dist/js/pages/dashboard3.js"></script>
  <!--  -->

  <script src="plugins/datatables/jquery.dataTables.min.js"></script>
  <script src="plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
  <script src="plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
  <script src="plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>
  <script src="dist/js/adminlte.min.js"></script>
  <script>
    function show_add() {
      document.getElementById("addcard").style.display = "";


    };
    function drop_add() {

      document.getElementById("addcard").style.display = "none";

    }
  </script>


  <script>
    $(function () {
      $("#example1").DataTable({
        "responsive": true,
        "autoWidth": false,
      });
      $('#example2').DataTable({
        "paging": true,
        "lengthChange": false,
        "searching": false,
        "ordering": true,
        "info": true,
        "autoWidth": false,
        "responsive": true,
      });
    });
  </script>

</body>

</html>